package com.ithw.intelligentcodeplatform.cconfig;

import dev.langchain4j.model.chat.StreamingChatModel;
import dev.langchain4j.model.openai.OpenAiStreamingChatModel;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "langchain4j.open-ai.chat-model")
@Data
// 配置推理流式模型
public class ReasoningStreamingChatModelConfig {

    private String baseUrl;

    private String apiKey;

    public StreamingChatModel reasoningStreamingChatModel() {
        // 测试环境为了保证输出速度 采用对话模型
       final String modelName = "deepseek-chat";
       final  int maxTokens = 8192;
        // 生产环境保证质量就是用推理模型
//        final String modelName = "deepseek-reasoner";
//         final  int maxTokens = 32768;
     return    OpenAiStreamingChatModel.builder()
                .apiKey(apiKey)
                .baseUrl(baseUrl)
                .modelName(modelName)
                .maxTokens(maxTokens)
                .logRequests(true)
                .logResponses(true)
                .build();
    }



}
